<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>


<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Personal Particulars</title>
<link href="<?php echo css_link('substyle.css','client','css');?>" rel="stylesheet" type="text/css">
<link href="<?php echo base_url().'public/date';?>/calendar.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="<?php echo base_url().'public/date';?>/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="<?php echo base_url().'public/date';?>/cal.js"></script>

<script>
jQuery(document).ready(function () {
	$('input.two').simpleDatepicker({ startdate: <?php echo 1900;?>, enddate: <?php echo (date('Y'));?> });
});
</script>
</head><body>
<?php $this->load->view('layout/logo');?>
<div id="wrap">
  <form id="form1" name="form1" method="post" action="">
    <table border="0" cellpadding="7" cellspacing="0">
      <tbody><tr>
        <td align="right"><strong>Title:</strong></td>
        <td colspan="2"><select name="title" class="field" id="title">
          <option value="Mr" selected="selected">Mr</option>
          <option value="Mrs">Mrs</option>
          <option value="Ms">Ms</option>
        </select>        </td>
      </tr>
      <tr>
        <td align="right"><strong>Name:</strong></td>
        <td colspan="2">
        	<input name="fullname" value="<?php echo (set_value('fullname') ? set_value('fullname') : $customer->fullname);?>" class="field" id="fullname" size="40" type="text">
        	<?php 
        	echo form_error('fullname');
        	?>
        </td>
      </tr>
      <tr>
        <td align="right"><strong>NRIC/FIN/Passport No.:</strong></td>
        <td colspan="2">
        	<input name="passport" value="<?php echo (set_value('passport') ? set_value('passport') : $customer->passport_no);?>" class="field" id="passport" size="20" type="text">
        	<?php 
        	echo form_error('passport');
        	?>
        </td>
      </tr>
      <tr>
        <td align="right"><strong>Marital Status:</strong></td>
        <td colspan="2">
	        <select name="marital" class="field" id="marital">
	          <option>-- Select --</option>
	          <option <?php echo($customer->marital_status == 'Single' ? 'selected="selected"' : '');?> value="Single">Single</option>
	          <option <?php echo($customer->marital_status == 'Married' ? 'selected="selected"' : '');?> value="Married">Married</option>
	          <option <?php echo($customer->marital_status == 'Divorced' ? 'selected="selected"' : '');?> value="Divorced">Divorced</option>
	        </select>
	    </td>
      </tr>
      <tr>
        <td align="right"><strong>Nationality:</strong></td>
        <td width="104"><select name="nationality" class="field" id="nationality" onchange="javascript:ShowDiv();">
          <option value="" selected="selected">-- Select --</option>
          <?php foreach($countries as $v):?>
          <option <?php echo($customer->nationality == $v->id ? 'selected="selected"' : '');?> value="<?php echo $v->id;?>"><?php echo $v->name;?></option>
          <?php endforeach;?>
          <option value="Others">Others</option>
                </select>
                
<script language="javascript"> 
	function ShowDiv(){
		var dropdown = document.getElementById("nationality");
		var index = dropdown.selectedIndex;
		var selectedDIV = dropdown.options[index].value;
		safeToggleFieldDisplay(selectedDIV);
	}
	function safeToggleFieldDisplay(field){
		try{
			if(field == 'Singaporean'){
				document.getElementById('specify').style.display = 'none';
			}
			else if(field == 'Others'){
				document.getElementById('specify').style.display = 'block';
			}
		}
		catch(exception){
			//no handling - just preventing page explosions
		}
	}
	//ShowDiv();
</script>                </td>
        <td width="98"><div id="specify" style="display: none;"><input name="other_nationality" class="field" id="other_nationality" onfocus="if(this.value==this.defaultValue) this.value='';" onblur="if(this.value=='') this.value=this.defaultValue;" value="Specify" size="24" type="text"></div></td>
      </tr>
      <tr>
        <td align="right"><strong>Date of Birth</strong></td>
        <td colspan="2">
        	<input class="inputDate two" id="inputDate" name="birth"  value="<?php echo (set_value('birth') ? set_value('birth') : ($customer->date_of_birth ? convert_dmysql_date($customer->date_of_birth) : 'MM/DD/YYYY'))?>" type="text">
        	<?php 
        	echo form_error("birth");
        	?>
        </td>
      </tr>
      <tr>
        <td align="right"><strong>Smoker:</strong></td>
        <td colspan="2">
	        <select name="smoker" class="field" id="smoker">
	          <option selected="selected">-- Select --</option>
	          <option <?php echo($customer->smoker == 'Yes' ? 'selected="selected"' : '');?> value="Yes">Yes</option>
	          <option <?php echo($customer->smoker == 'No' ? 'selected="selected"' : '');?> value="No">No</option>
	        </select>
	    </td>
      </tr>
      <tr>
        <td align="right"><strong>Occupation:</strong></td>
        <td colspan="2"><input value="<?php echo(isset($_POST['occupation']) ? $_POST['occupation'] :($customer->occupation ? $customer->occupation : ''));?>" name="occupation" class="field" id="occupation" size="40" type="text"></td>
      </tr>
      <tr>
        <td align="right">&nbsp;</td>
        <td colspan="2"><button class="large button red"	>Submit</button></td>
      </tr>
      <tr>
        <td align="left"><a href="javascript:window.close();"><img src="<?php echo img_link('cwindow.jpg');?>" alt="Close Window" height="15" width="82" border="0"></a></td>
        <td colspan="2">&nbsp;</td>
      </tr>
    </tbody></table>
    
   
    
  </form>
  
  
</div>
</body></html>